cmake_minimum_required(VERSION 2.4)

PROJECT(sampling)

SET(CMAKE_BUILD_TYPE Release)
#SET(CMAKE_BUILD_TYPE Debug)

set(CMAKE_MODULE_PATH "~/src/EM/superpixels/modules/")

set(CMAKE_C_COMPILER "g++")
set(CMAKE_CXX_COMPILER "g++")

set(CMAKE_CXX_FLAGS_DEBUG   "${CMAKE_CXX_FLAGS} -g -pg")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -O3")

set(CMAKE_C_FLAGS         ${CMAKE_CXX_FLAGS})
set(CMAKE_C_FLAGS_DEBUG   ${CMAKE_CXX_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE})

###################################################################### PACKAGES

#SET(OpenCV_FIND_COMPONENTS   CV CXCORE CVAUX HIGHGUI ML)
#SET(OpenCV_FIND_REQUIRED_COMPONENTS   CV CXCORE CVAUX HIGHGUI ML)
FIND_PACKAGE(OpenCV REQUIRED)
# add include directories
include_directories(${OPENCV_INCLUDE_DIR})
find_library(ML_LIBRARY NAMES ml PATHS /usr/lib)
SET(OPENCV_LIBRARIES ${OPENCV_LIBRARIES} ${ML_LIBRARY})

find_package(GSL)
IF(${GSL_FOUND})
  include_directories(${GSL_INCLUDE_DIR})
  set(CMAKE_CXX_FLAGS  "${CMAKE_CXX_FLAGS} -D WITH_GSL")
ENDIF(${GSL_FOUND})

####################################################################### LIBRARY

add_executable(gibbsDemoDenoising
gibbsDemoDenoising.cpp
)

TARGET_LINK_LIBRARIES(gibbsDemoDenoising ${OPENCV_LIBRARIES} ${GSL_LIBRARIES})


